import 'package:app_admin/pages/home/home_binding.dart';
import 'package:app_admin/pages/home/home_view.dart';
import 'package:app_admin/pages/login/login_binding.dart';
import 'package:app_admin/pages/login/login_view.dart';
import 'package:app_admin/pages/orderPlan/orderPlan_binding.dart';
import 'package:app_admin/pages/orderPlan/orderPlan_view.dart';
import 'package:app_admin/pages/orderPlanAdd/orderPlan_add_binding.dart';
import 'package:app_admin/pages/orderPlanAdd/orderPlan_add_view.dart';
import 'package:app_admin/pages/orderSet/orderSet_binding.dart';
import 'package:app_admin/pages/orderSet/orderSet_view.dart';
import 'package:app_admin/pages/orderSetAdd/orderSet_add_binding.dart';
import 'package:app_admin/pages/orderSetAdd/orderSet_add_view.dart';
import 'package:app_admin/pages/select/select_binding.dart';
import 'package:app_admin/pages/select/select_view.dart';
import 'package:app_admin/pages/splash/splash_binding.dart';
import 'package:app_admin/pages/splash/splash_view.dart';
import 'package:get/get.dart';
part 'app_routes.dart';

class AppPages {
  static _pageBuilder({
    required String name,
    required GetPageBuilder page,
    Bindings? binding,
    bool preventDuplicates = true,
  }) =>
      GetPage(
        name: name,
        page: page,
        binding: binding,
        preventDuplicates: preventDuplicates,
        transition: Transition.cupertino,
        popGesture: true,
      );

  static final routes = <GetPage>[
    _pageBuilder(
      name: AppRoutes.splash,
      page: () => SplashPage(),
      binding: SplashBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.login,
      page: () => LoginPage(),
      binding: LoginBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.home,
      page: () => HomePage(),
      binding: HomeBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.orderSet,
      page: () => OrderSetPage(),
      binding: OrderSetBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.orderSetAdd,
      page: () => OrderSetAddPage(),
      binding: OrderSetAddBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.orderSetPlan,
      page: () => OrderPlanPage(),
      binding: OrderPlanBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.orderSetPlanAdd,
      page: () => OrderPlanAddPage(),
      binding: OrderPlanAddBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.select,
      page: () => SelectPage(),
      binding: SelectBinding(),
    ),
  ];
}
